package com.mm.fam.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mm.fam.web.entity.SysUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zt
 * @since 2018-09-29
 */
@Repository
public interface SysUserMapper extends BaseMapper<SysUser> {

    IPage<SysUser> queryUserList(IPage<SysUser> page, @Param("paramMap") Map<String, Object> paramMap);

    // 删除角色前查询角色下是否已分配权限
    public int queryPerAllocationNumOfRole(Integer roleId);

    // 根据id逻辑删除用户
    Integer delUserbyId(Integer userId);
    //新建或者编辑时判断是否存在用户名
    Integer queryUserNameExist(Map<String, Object> map);

    Integer updataSysUser(SysUser sysUser);

    /**
     * 查询机构用户最大工号
     * @return
     */
    Integer queryOrganizationUserMaxJobNo();

    List<SysUser> queryRiskerListSimple();
}
